package com.itheima.provider.controller;

import com.itheima.provider.dao.GoodsDao;
import com.itheima.provider.domain.Goods;
import com.itheima.provider.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("goods")
public class goodsController {
    @Autowired
    private GoodsService goodsService;
    @RequestMapping("/findOne/{id}")
    public Goods  findOne(@PathVariable("id") Integer id ){
        Goods goods = this.goodsService.findOne(id);
         return  goods;

    }
}
